﻿using IveelySE.Dream.Common;
using IveelySE.Dream.Common.Transmission;
/*
 * Created by SharpDevelop.
 * User: Iveely Liu
 * Date: 2013/4/4
 * Time: 20:14
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Threading;

namespace IveelySE.Dream.Controller
{
    /// <summary>
    ///  读信息控制中心类
    /// </summary>
    public class ReaderController
    {
        /// <summary>
        /// （服务端）通信工具
        /// </summary>
        private ServerProcesspor communicater;

        public ReaderController()
        {
            this.communicater = new IveelySE.Dream.Common.Transmission.ServerProcesspor();
        }

        /// <summary>
        /// 启动读者管理控制中心
        /// </summary>
        public void Start()
        {
            this.communicater.Start(8086);
        }

        /// <summary>
        /// 获取所有读者集合
        /// </summary>
        /// <returns></returns>
        public List<ClientInfo> GetReaders()
        {
            return this.communicater.GetClientInfo();
        }

        /// <summary>
        /// 关闭读者管理控制中心
        /// </summary>
        public void Close()
        {
            this.communicater.Close();
        }


    }
}
